home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xsw / include / sepwin.h < prev    next >
C/C++ Source or Header  |  1995-07-07  |  12KB  |  346 lines

  1. /*
  2.  *    @(#) sepwin.h 12.1 95/07/07 SCOINC
  3.  */
  4. /***************************************************************************
  5.  *
  6.  *    Copyright (c) 1990-1993        The Santa Cruz Operation, Inc.
  7.  *
  8.  *    All rights reserved.  No part of this program or publication may be
  9.  *    reproduced, transmitted, transcribed, stored in a retrieval system,
  10.  *    or translated into any language or computer language, in any form or
  11.  *    by any means, electronic, mechanical, magnetic, optical, chemical,
  12.  *    biological, or otherwise, without the prior written permission of:
  13.  *
  14.  *        The Santa Cruz Operation , Inc.        (408) 425-7222
  15.  *        400 Encinal St., Santa Cruz, California 95060 USA
  16.  *
  17.  **************************************************************************/
  18.  
  19. /*
  20.  *    SCCS Stuff
  21.  *        
  22.  *    @(#) sepwin.h 12.1 95/07/07 SCOINC
  23.  *
  24.  * S001, 21-Sep-93, rickra
  25.  *    Added some stuff....
  26.  *
  27.  * S000, 27-May-93, rickra
  28.  *     Initial check in.
  29. */
  30.  
  31.  
  32. typedef struct ClientStruct
  33. {
  34.   char           *classname;
  35.  
  36. }               ClientStuff;
  37.  
  38. static ClientStuff Client_decl[] =
  39. {
  40.   {"xsw_cpu_"},
  41.   {"xsw_wait_"},
  42.   {"xsw_cache_"},
  43.   {"xsw_other_"},
  44.   {"xsw_ps_cpu_"},
  45.   {"xsw_ps_io_"},
  46.   {"xsw_ps_mem_"},
  47.   {"xsw_streams_"},
  48.   {"xsw_nfsstat_"},
  49.   {"xsw_sysinfo_"},
  50.   {"xsw_vbt_"},
  51.   {"xsw_dev_stats_"},
  52.   {"xsw_mem_"},
  53.   {"xsw_disk_space_"},
  54. };
  55.  
  56. extern struct NetworkXswStruct *current_server;
  57. extern struct NetworkXswStruct *toggle_button_current_server;
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. #define LEFT_SIDE_OFFSET 0
  66. #define RIGHT_SIDE_OFFSET 1
  67.  
  68.  
  69. #define BUTTON_OFF    0
  70. #define BUTTON_ON    1
  71.  
  72. /*
  73.  * Button types....
  74.  */
  75.  
  76. #define SORT_BUTTON    0    /* Left justified....      */
  77.  
  78. #define CUM_CUR_BUTTON        1    /* CUM/CUR....         */
  79. #define ASCEND_DESCEND_BUTTON    2    /* A/D....         */
  80. #define PERCENT_OTHER_BUTTON    3    /* %/T/M....         */
  81. #define SCREEN_SWITCH_BUTTON    4    /* */
  82. #define FILTER_BUTTON        5    /* To filter something....*/
  83. #define SHOW_NFS_BUTTON        6    /* To filter something....*/
  84. #define SHOW_TOTAL_BUTTON    7    /* To filter something....*/
  85.  
  86. typedef struct _ps_menu_struct
  87. {
  88.   int          screen_number;
  89.   char           *name;        /* name of the button          */
  90.   int             state;    /* button on or off          */
  91.   int             type;        /* button type           */
  92.   int             offset_side;    /* offset side: left/right     */
  93.   int             offset;    /* offset from attachment     */
  94.   void            (*func) ();    /* Callback to be invoked      */
  95. }               ps_menu_struct;
  96.  
  97.  
  98. typedef struct _multi_screen_window_struct
  99. {
  100.     char    *default_title;
  101.     char    *default_pulldown_label;
  102. }        multi_screen_window_struct;
  103.  
  104.  
  105. typedef struct _option_window_struct
  106. {
  107.     int    type;            /* 1 == toggle */
  108.                     /* 0 == mult-view */
  109.     int    number_views;
  110.             
  111.     char    *default_pulldown_label;
  112.     char    *default_label;
  113.  
  114.  
  115.  
  116. }        option_window_struct;
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. typedef struct ps_button_callback_struct
  124. {
  125.   struct NetworkXswStruct *server_pointer;
  126.   int             sort_mode;    /* toggle button number..... */
  127.   int             button_num;    /* PS button... BUTTON_ps_cpu  */
  128.   ps_menu_struct *ps_menu;
  129.   multi_screen_window_struct *ps_screen;
  130.   int            ps_screen_number;
  131.   int             ps_menu_index;
  132. }               PS_BUTTON_CALLBACK_STRUCT;
  133.  
  134.  
  135. typedef struct window_button_callback_struct
  136. {
  137.   struct NetworkXswStruct *server_pointer;
  138.   int             sort_mode;    /* toggle button number..... */
  139.   int             button_num;   /* PS button... BUTTON_ps_cpu  */
  140.   ps_menu_struct *ps_menu;
  141.   multi_screen_window_struct *ps_screen;
  142.   int                   ps_screen_number;
  143.   int             ps_menu_index;
  144.   int             type;
  145.   int             dynamic_window_index;
  146. }               WINDOW_BUTTON_CALLBACK_STRUCT;
  147.  
  148.  
  149. typedef struct scrolled_ps_callback_struct
  150. {
  151.   struct NetworkXswStruct *server_pointer;
  152.   ps_menu_struct *ps_menu;
  153.   int             button_number;
  154.   int             number_of_buttons;
  155.   int             number_of_screens;
  156. }               SCROLLED_PS_CALLBACK_STRUCT;
  157.  
  158.  
  159.  
  160.  
  161.  
  162. void
  163.                 expose_callback (Widget widget,
  164.                  struct expose_callback_struct *client_data,
  165.                  XmDrawingAreaCallbackStruct * call_data);
  166. void
  167.                 input_callback (Widget widget,
  168.                 struct NetworkXswStruct *client_data,
  169.                 XmDrawingAreaCallbackStruct * call_data);
  170. void
  171.                 ps_button_callback (Widget my_widget,
  172.              struct ps_button_callback_struct *ps_button_struct,
  173.                     XmToggleButtonCallbackStruct * cbs);
  174.  
  175. /*
  176.  * Begin PS CPU structures....
  177.  */
  178.  
  179. static ps_menu_struct ps_toggle_button_data[] =
  180. {
  181. {0,"S", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 0, ps_button_callback},
  182. {0,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 6, ps_button_callback},
  183. {0,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 13, ps_button_callback},
  184. {0,"CPU", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 17, ps_button_callback},
  185. {0,"PRI", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 21, ps_button_callback},
  186. {0,"NI", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 25, ps_button_callback},
  187. {0,"UCPU", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 30, ps_button_callback},
  188. {0,"SCPU", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 37, ps_button_callback},
  189. {0,"U+S", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 45, ps_button_callback},
  190. {0,"SIZE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 49, ps_button_callback},
  191. {0,"TTY", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 54, ps_button_callback},
  192. {0,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 58, ps_button_callback}
  193. /*
  194. {0,"CUR", BUTTON_ON, CUM_CUR_BUTTON, RIGHT_SIDE_OFFSET, 0, ps_button_callback},
  195. {0,"D",BUTTON_ON,ASCEND_DESCEND_BUTTON,RIGHT_SIDE_OFFSET,4, ps_button_callback},
  196. {0,"%",BUTTON_ON,PERCENT_OTHER_BUTTON, RIGHT_SIDE_OFFSET, 7, ps_button_callback}
  197. */
  198. };
  199.  
  200. /*
  201.  * Begin PS I/O structures....
  202.  */
  203.  
  204. static ps_menu_struct ps_io_toggle_button_data[] =
  205. {
  206. {0,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 0, ps_button_callback},
  207. {0,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 13, ps_button_callback},
  208. {0,"SWAP", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 19, ps_button_callback},
  209. {0,"CHAR", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 32, ps_button_callback},
  210. {0,"READ", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 39, ps_button_callback},
  211. {0,"WRITE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 45, ps_button_callback},
  212. {0,"TOTAL", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 54, ps_button_callback},
  213. {0,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 60, ps_button_callback}
  214. /*
  215. {0,"CUR", BUTTON_ON, CUM_CUR_BUTTON, RIGHT_SIDE_OFFSET, 0, ps_button_callback},
  216. {0,"D",BUTTON_ON,ASCEND_DESCEND_BUTTON,RIGHT_SIDE_OFFSET,4, ps_button_callback},
  217. {0,"%",BUTTON_ON,PERCENT_OTHER_BUTTON,RIGHT_SIDE_OFFSET,7, ps_button_callback}
  218. */
  219. };
  220.  
  221. /*
  222.  * Begin PS MEM structures....
  223.  */
  224.  
  225. static ps_menu_struct ps_mem_toggle_button_data[] =
  226. {
  227. {0,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 4, ps_button_callback},
  228. {0,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 11, ps_button_callback},
  229. {0,"VSIZE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 17, ps_button_callback},
  230. {0,"SHRD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 25, ps_button_callback},
  231. {0,"PRIV", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 31, ps_button_callback},
  232. {0,"WTD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 37, ps_button_callback},
  233. {0,"TOTAL", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 42, ps_button_callback},
  234. {0,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 49, ps_button_callback},
  235.  
  236. {1,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 4, ps_button_callback},
  237. {1,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 11, ps_button_callback},
  238. {1,"VSIZE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 17, ps_button_callback},
  239. {1,"NONE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 25, ps_button_callback},
  240. {1,"SWAP", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 31, ps_button_callback},
  241. {1,"FILE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 37, ps_button_callback},
  242. {1,"LSTFILE",BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 42, ps_button_callback},
  243. {1,"TOTAL", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 51, ps_button_callback},
  244. {1,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 58, ps_button_callback},
  245.  
  246. {2,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 4, ps_button_callback},
  247. {2,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 11, ps_button_callback},
  248. {2,"VSIZE", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 17, ps_button_callback},
  249. {2,"NONE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 25, ps_button_callback},
  250. {2,"SWAP", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 31, ps_button_callback},
  251. {2,"FILE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 37, ps_button_callback},
  252. {2,"LSTFILE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET, 42, ps_button_callback},
  253. {2,"ZERO", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 52, ps_button_callback},
  254. {2,"FILL", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 59, ps_button_callback},
  255. #ifndef XSW32v5
  256. {2,"IOMAP", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 65, ps_button_callback},
  257. {2,"WINDOW", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 71, ps_button_callback},
  258. #else 
  259. {2,"PROC", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 65, ps_button_callback},
  260. #endif
  261. {2,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 79, ps_button_callback},
  262.  
  263. {3,"USER", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 4, ps_button_callback},
  264. {3,"PID", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 11, ps_button_callback},
  265. {3,"VSIZE", BUTTON_ON, SORT_BUTTON, LEFT_SIDE_OFFSET, 17, ps_button_callback},
  266. {3,"SWAP", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 25, ps_button_callback},
  267. {3,"FILE", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 31, ps_button_callback},
  268. {3,"LSTFILE",BUTTON_OFF,SORT_BUTTON, LEFT_SIDE_OFFSET, 37, ps_button_callback},
  269. {3,"CMD", BUTTON_OFF, SORT_BUTTON, LEFT_SIDE_OFFSET, 46, ps_button_callback}
  270. };
  271.  
  272. /*
  273.  * Begin Disk Space structures....
  274.  */
  275.  
  276. static ps_menu_struct disk_space_toggle_button_data[] =
  277. {
  278. {0,"TOTAL",BUTTON_ON,SORT_BUTTON,LEFT_SIDE_OFFSET,3, ps_button_callback},
  279. {0,"USED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,14, ps_button_callback},
  280. {0,"FREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,24, ps_button_callback},
  281. {0,"% USED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,33,ps_button_callback},
  282. {0,"% FREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,43,ps_button_callback},
  283. {0,"MOUNT PT. & FILESYSTEM",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,50,ps_button_callback},
  284.  
  285. {1,"BLOCKS",BUTTON_ON,SORT_BUTTON,LEFT_SIDE_OFFSET,2, ps_button_callback},
  286. {1,"USED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,14, ps_button_callback},
  287. {1,"FREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,24, ps_button_callback},
  288. {1,"% USED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,33,ps_button_callback},
  289. {1,"% FREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,43,ps_button_callback},
  290. {1,"MOUNT PT. & FILESYSTEM ",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,50,ps_button_callback},
  291.  
  292. {2,"ITOTAL",BUTTON_ON,SORT_BUTTON,LEFT_SIDE_OFFSET,2, ps_button_callback},
  293. {2,"IUSED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,13, ps_button_callback},
  294. {2,"IFREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,23, ps_button_callback},
  295. {2,"% IUSED",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,32,ps_button_callback},
  296. {2,"% IFREE",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,42,ps_button_callback},
  297. {2,"MOUNT PT. & FILESYSTEM ",BUTTON_OFF,SORT_BUTTON,LEFT_SIDE_OFFSET,50,ps_button_callback}
  298. };
  299.  
  300.  
  301. static  multi_screen_window_struct ps_mem_screens[] =
  302. {
  303. {"Core Storage Only: Private & Shared", "Core Storage Only: Private & Shared"},
  304. {"Core Storage Only","Core Storage Only"},
  305. {"All Storage","All Storage"},
  306. {"Secondary Storage Only","Secondary Storage Only"}
  307. };
  308.  
  309. static  multi_screen_window_struct ps_cpu_screens[] =
  310. {
  311. {"PS CPU UTILIZATION: User & System","CPU"}
  312. };
  313.  
  314. static  multi_screen_window_struct ps_io_screens[] =
  315. {
  316. {"PS IO UTILIZATION:","IO"}
  317. };
  318.  
  319. static  multi_screen_window_struct disk_space_screens[] =
  320. {
  321. {"DISK SPACE ALLOCATION IN MB","MB SPACE"},
  322. {"BLOCK ALLOCATION","BLOCKS"},
  323. {"INODE ALLOCATION","INODES"}
  324. };
  325.  
  326. static  option_window_struct disk_space_options[] =
  327. {
  328.  
  329. {0,0,"TEST1","TEST1"},
  330. {0,0,"TEST2","TEST2"},
  331. {0,0,"TEST3","TEST3"},
  332. {0,0,"TEST4","TEST4"},
  333. {0,0,"TEST5","TEST5"},
  334. {0,0,"TEST6","TEST6"},
  335. {0,0,"TEST7","TEST7"}
  336. /*
  337. {0,3,"VIEW",NULL},
  338. {1,0,"MB SPACE","DISK SPACE ALLOCATION IN MB"},
  339. {1,0,"BLOCKS","BLOCK ALLOCATION"},
  340. {1,0,"INODES","INODE ALLOCATION"},
  341. {0,0,"SHOW NFS",NULL},
  342. {0,0,"SHOW TOTAL",NULL}
  343. */
  344.  
  345. };
  346.